import requestPlat from '@/common/requestPlat'
import Qs from "qs";

// 我的可切换的团队列表
export function listTeamrole(params) {
  return requestPlat({
    url: `procure/team/teamrole/list`,
    method: 'get',
    params: params
  })
}
// 搜索团队
export function searchTeam(params) {
  return requestPlat({
    url: `procure/data/team/page/${params.page}/${params.limit}`,
    method: 'get',
    params: params
  })
}
// 我加入的团队列表
export function pageMyJoinTeam(params) {
  return requestPlat({
    url: `procure/user/teamrole/page/${params.page}/${params.limit}`,
    method: 'get',
    params: params
  })
}
// 加入团队
export function addMyJoinTeam(data) {
  return requestPlat({
    url: `procure/user/teamrole/add`,
    method: 'post',
	headers:{
		"Content-Type": 'application/json'
	},
    data
  })
}
// 离开团队
export function delMyJoinTeam(data) {
  return requestPlat({
    url: `procure/user/teamrole/del?id=${data.id}`,
    method: 'post',
  })
}




// 某个团队下的成员列表
// export function pageTeam(params) {
//   return requestPlat({
//     url: `procure/data/team/page/${params.page}/${params.limit}`,
//     method: 'get',
//     params: params
//   })
// }
// 我的团队列表
export function pageMyTeam(params) {
  return requestPlat({
    url: `procure/user/team/page/${params.page}/${params.limit}`,
    method: 'get',
    params: params
  })
}
// 我的团队详情
export function detailMyTeam(params) {
  return requestPlat({
    url: `procure/user/team/detail`,
    method: 'get',
    params: params
  })
}
// 创建团队
export function addTeam(data) {
  return requestPlat({
    url: `procure/user/team/add`,
    method: 'post',
	headers:{
		"Content-Type": 'application/json'
	},
    data
  })
}
// 编辑团队
export function editTeam(data) {
  return requestPlat({
    url: `procure/user/team/edit`,
    method: 'post',
	headers:{
		"Content-Type": 'application/json'
	},
    data
  })
}
// 我的团队下成员列表
export function pageMyTeamMember(params) {
  return requestPlat({
    url: `procure/team/teamrole/page/${params.page}/${params.limit}`,
    method: 'get',
    params: params
  })
}
// 成员状态修改
export function statusMyTeamMember(data) {
  return requestPlat({
    url: `procure/team/teamrole/status?opid=${data.opid}&status=${data.status}`,
    method: 'post',
  })
}
// 添加成员
export function addMyTeamMember(data) {
  return requestPlat({
    url: `procure/team/teamrole/add`,
    method: 'post',
	headers:{
		"Content-Type": 'application/json'
	},
	data
  })
}
// 编辑成员
export function editMyTeamMember(data) {
  return requestPlat({
    url: `procure/team/teamrole/edit`,
    method: 'post',
	headers:{
		"Content-Type": 'application/json'
	},
	data
  })
}
// 删除成员
export function delMyTeamMember(data) {
  return requestPlat({
    url: `procure/team/teamrole/del?opid=${data.opid}`,
    method: 'post',
  })
}


// 获取数量
export function getTeamHome(params) {
  return requestPlat({
    url: `procure/team/home`,
    method: 'get',
    params: params
  })
}



// 获取广告
export function getAdvertising(params) {
  return requestPlat({
    url: `procure/team/procureLeaflet/list`,
    method: 'get',
    params: params
  })
}

// 获取广告详情
export function getAdvertisingDetail(params) {
  return requestPlat({
    url: `procure/team/procureLeaflet/detail`,
    method: 'get',
    params: params
  })
}


// 切换站点团队
export function teamSwitch(params) {
  return requestPlat({
    url: `procure/team/login/switch`,
    method: 'post',
    params: params
  })
}


// 商户详情
export function teamDetail(params) {
  return requestPlat({
    url: `procure/authorize/team/detail`,
    method: 'get',
    params: params
  })
}
